/*
 *  Cero Project - Copyright   2006 The Cero Developement Team 
 *  (Michael Laguerre, Camille Roux, Matthieu Segret, Mathieu Sivade) 
 * 
 *  This program is free software; you can redistribute it and/or modify it 
 *  under the terms of the GNU General Public License as published by the Free 
 *  Software Foundation; either version 2 of the License, or (at your option) 
 *  any later version.
 * 
 *  This program is distributed in the hope that it will be useful, but 
 *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
 *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
 *  for more details.
 */

package org.ceroproject.games.base;

import org.ceroproject.games.Card;

/**
 * Base class to create cards uniquely identified by their id
 *
 * @author Telem
 */
public abstract class CardBase implements Card {
	private static int currentID = 0;
	
	private int nextID() {
		return currentID++;
	}
	
	private int cardID;
	
	public CardBase() {
		cardID = nextID();
	}
	
	protected CardBase(int id) {
		cardID = id;
	}

	public int getCardId() {
		return cardID;
	}
	
	public String toString() {
		return getCardName() + " (id:" + cardID+")";
	}
}
